package tests;

import static org.junit.Assert.fail;
import static util.Constant.STR_EXCEPTION_SHOULD_HAVE_OCCURED;
import static util.Constant.STR_NAME_NULL;
import junit.framework.Assert;
import lib.CommentManager;

import org.junit.Test;

import base.User;

public class CommentManagerTest {

	@Test
	public void testCreate() {
		CommentManager commentManager = CommentManager.getInstance();	
		try {
			commentManager.create("", new User());
			fail(STR_EXCEPTION_SHOULD_HAVE_OCCURED);
		} catch (Exception e) {
			Assert.assertEquals(STR_NAME_NULL, e.getMessage());
		}
		
		try {
			commentManager.create(null, new User());
			fail(STR_EXCEPTION_SHOULD_HAVE_OCCURED);
		} catch (Exception e) {
			Assert.assertEquals(STR_NAME_NULL, e.getMessage());
		}
	}
}
